home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #11 / Amiga Plus CD - 2004 - No. 11.iso / AmiSoft / Text / print / HPDJ870Src.lha / density.c < prev    next >
C/C++ Source or Header  |  2004-05-15  |  1KB  |  45 lines

  1. /*
  2.  *
  3.  *       Density module for HP_DeskJet_870C
  4.  *
  5.  *       Includes the new 600 dpi resolution.
  6.  */
  7.  
  8. #include "global.h"
  9.  
  10.  
  11. #define DENSITY 15
  12.  
  13. extern struct PrinterData *PD;
  14. extern struct PrinterExtendedData *PED;
  15. extern char StartCmd[];
  16.  
  17. void SetDensity(ULONG density_code)
  18. {
  19.         /* SPECIAL_DENSITY     0   1   2    3    4    5    6    7 */
  20.         static int XDPI[8] = {150, 150, 150, 300, 300, 600, 600, 600};
  21.         static char codes[8][3] = {
  22.         {'1','5','0'},{'2','5','0'},{'1','5','0'},{'3','0','0'},
  23.         {'3','0','0'},{'6','0','0'},{'6','0','0'},{'6','0','0'},
  24.         };
  25.         density_code /= SPECIAL_DENSITY1;
  26.         PED->ped_MaxXDots = XDPI[density_code] * 8;
  27.  
  28.         /* David Berezowski - April 22/90 */
  29.         /* default is 10.0, US_LEGAL is 14.0 */
  30.         PED->ped_MaxYDots =
  31.                 PD->pd_Preferences.PaperSize == US_LEGAL ? 14 : 10;
  32.         PED->ped_MaxYDots *= XDPI[density_code];
  33.  
  34.         PED->ped_XDotsInch = PED->ped_YDotsInch = XDPI[density_code];
  35.         
  36.         /* Density 5 = 600 x 300 */
  37.         if (density_code == 5) {
  38.             PED->ped_YDotsInch = 300;
  39.             PED->ped_MaxYDots /= 2;
  40.         }
  41.         StartCmd[DENSITY]   = codes[density_code][0];
  42.         StartCmd[DENSITY+1] = codes[density_code][1];
  43.         StartCmd[DENSITY+2] = codes[density_code][2];
  44. }
  45.